#!/usr/bin/python

import sys
import Image

def vertical_sum(inf):
	im = Image.open(inf)
        nim = im.convert("1")
        (width, height) = im.size

	f = open('/tmp/data', 'w')
	
	pix = nim.load()
	for y in range(height):
		cnt = 1
		for x in range(width):
			if ( pix[x, y] == 0 ):
				cnt = cnt + 1
		f.write(str(cnt)+"\n")
	f.close()

		
	
	
	
if __name__ == '__main__':
        argvs = sys.argv
        argc  = len(argvs)
        if ( argc != 2 ):
                print "Usage: tool <FileName>"
                sys.exit(1)
        vertical_sum(argvs[1])




	
